//单向链表
public class Test {

    static class ListNode{

        public int val;

        public ListNode next;

        public ListNode(int val) {
            this.val = val;
        }

    }

    public ListNode head;
}

//双向链表
/*public class Test{

    static class ListNode {

        public int val;

        public ListNode prev;

        public ListNode next;

        public ListNode(int val) {
            this.val = val;
        }
    }

    public ListNode head;

    public ListNode last;
}*/
